package com.mlnx.ui.service.impl;

import com.mlnx.service.base.service.BaseService;
import com.mlnx.ui.dao.GroupMapper;
import com.mlnx.ui.entity.Group;
import com.mlnx.ui.pojo.dto.GroupDTO;
import com.mlnx.ui.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class GroupServiceImpl extends BaseService<GroupMapper, Group> implements GroupService {
    @Autowired
    @Override
    public void setBaseMapper(GroupMapper baseMapper) {
        super.setBaseMapper(baseMapper);
    }

    @Override
    public List<GroupDTO> getAllGroups(Integer userId, boolean taizhou) {
        Map<String, Object> paramMap = new HashMap();
        paramMap.put("userId", userId);
        paramMap.put("taizhou", taizhou);

        return baseMapper.selectGroupsByUserId(paramMap);
    }
}
